home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 2 / AACD 2.iso / AACD / Programming / MUI / muitoolkit / developer / autodocs / MuiToolkit.doc
Encoding:
Text File  |  1999-09-18  |  32.2 KB  |  1,195 lines

  1. TABLE OF CONTENTS
  2.  
  3. MuiToolkit/-Preface-
  4. MuiToolkit/mt_Get
  5. MuiToolkit/mt_ParseHotkey
  6. MuiToolkit/mt_Label
  7. MuiToolkit/mt_PopButton
  8. MuiToolkit/mt_Checkmark
  9. MuiToolkit/mt_Cycle
  10. MuiToolkit/mt_CycleWeight
  11. MuiToolkit/mt_Slider
  12. MuiToolkit/mt_SliderFmt
  13. MuiToolkit/mt_String
  14. MuiToolkit/mt_StringSecret
  15. MuiToolkit/mt_StringAccept
  16. MuiToolkit/mt_StringReject
  17. MuiToolkit/mt_Button
  18. MuiToolkit/mt_ButtonWeight
  19. MuiToolkit/mt_ButtonToggle
  20. MuiToolkit/mt_WinOpen
  21. MuiToolkit/mt_WinClose
  22. MuiToolkit/mt_WinAttach
  23. MuiToolkit/mt_WinDetach
  24. MuiToolkit/mt_Text
  25. MuiToolkit/mt_GetStringA
  26. MuiToolkit/mt_GetIntegerA
  27. MuiToolkit/mt_Radio
  28. MuiToolkit/mt_Check
  29.  
  30. MuiToolkit/-Preface-
  31.  
  32. Anyone being the author of more than one MUI based application most
  33. probably realized, that using some predefined MUI macros
  34. (<libraries/mui.h>) speeds up 'writting' the GUI, but most of the authors
  35. sooner of later write their own bunch of functions and uses them for
  36. creation of the gui instead of standard one.  And so did I, creating my own
  37. pool of routines I use in my apps to approach "TLBRTS" (Type Less But Reach
  38. The Same{tm} ;-) goal.
  39.  
  40.  
  41. 1. Why ppl creates own functions while, as I said, mui.h defines
  42.    some useful you said macros?
  43.  
  44. IMHO mostly because these macros are useful but very limited.  To make your
  45. GUI nice and useable you still have to set other tags by hand.  For
  46. instance Cycle() macro most of ppl use to create Cycle objects does not put
  47. your object in cycle chain (so your user can't activate your object while
  48. browsing thru the object chain with TAB).  It also does not help you making
  49. your cycle object hotkey driven.  And the I find most lame is, especially
  50. in context of MUI based applications, the lack of keyboard control.  That
  51. the user's point of view.  As programmer, I don't like typing too much,
  52. especially I know it can look simplier.
  53.  
  54.  
  55. 2. Any clue then?
  56.  
  57. I just moved all my own MUI related helper-functions into the shared
  58. library (named muitoolkit as you probably guessed).  It features all
  59. helper-functions *I* use in my apps to create user interface.  For example,
  60. to create basic but 'comfortable' string object, with bubble help, hotkey
  61. and being cycle chaied, instead of typing:
  62.  
  63. obj = StringObject,
  64.               MUIA_Frame, MUIV_Frame_String,
  65.               MUIA_ControlChar, 't',
  66.               MUIA_String_MaxLen, maxlen,
  67.               MUIA_CycleChain, TRUE,
  68.               MUIA_String_AdvanceOnCR, TRUE,
  69.               MUIA_String_Contents, "str",
  70.               MUIA_String_MaxLen, 30,
  71.               MUIA_ShortHelp, "I hate typing",
  72.               End;
  73.  
  74. I just type:
  75.  
  76. obj = mt_String("hi", 30, "_Type something", "I love that");
  77.  
  78. and voila. Nice? Hope so ;-)
  79.  
  80. Note:  the hotkey in the above example is automatically extracted out of
  81. the "_Type something" label string.  It may look stupid at the 1st sight,
  82. but if you realize, the most hotkey driven objects are paired with labels,
  83. then you probably find out that the string "_Type something" is in fact the
  84. label string.  So you pass the same string to mt_Label() call while
  85. creating the label, and to related mt_String() (or any other MT object) and
  86. you are done with hotkey driven object.  It became even more 'natural' when
  87. you use localization (and you should)), so your translators have easier
  88. job.
  89.  
  90. Among the object creation functions, MuiToolkit also features string,
  91. numeric string requester (something like ReqTools offers for instance) etc.
  92. And I plan more of course. For now, don't forget to watch enclosed
  93. demo program!
  94.  
  95.  
  96. 3. Who would benefit from using such library?
  97.  
  98. I think we all could.  Programmers (some of us), because they can type less
  99. and still got good and user friendly interfaces.  The app will reduce in
  100. size (well, recently not much about 10K, but it's v1.0, but later, who
  101. knows ;).  The users (we all), because the GUI of MUI programs may start to
  102. be less 'primitive' and more "friendly".  I hope "user friendly" would stop
  103. mean that "the user have to be friendly", which is unfortunately ofter for
  104. not, only begginers' app.
  105.  
  106.  
  107. 4. Fees?
  108.  
  109. MuiToolkit is and will remain freeware.  The source will be placed in CVS
  110. so anyone would be able to contribute (welcome, welcome!) or to bug fix.
  111.  
  112.  
  113. 5. Author
  114.  
  115.    Marcin Orlowski
  116.    P.O. Box 91
  117.    71-507 Szczecin 5
  118.    Poland
  119.  
  120.    e-mail: carlos@amiga.com.pl
  121.    WWW:    http://wfmh.org.pl/~carlos/
  122.  
  123.  
  124.    $Id: muitoolkit.doc,v 1.2 1999/09/01 21:28:43 carlos Exp $
  125.  
  126. MuiToolkit/mt_Get
  127.  
  128.     NAME
  129.     mt_Get - easier getting object arguments
  130.  
  131.     SYNOPSIS
  132.     mt_Get( object, attribute );
  133.             A0      D0
  134.  
  135.     ULONG mt_Get( Object *object, ULONG attribute );
  136.  
  137.     FUNCTION
  138.     Just easier to use get() macro replacement. Instead
  139.     of giving the pointer to ULONG for the result value
  140.     (that's the often begginers' bug), you get it returned
  141.     as from other functions.
  142.  
  143.     INPUTS
  144.     object      - the pointer to Object to query
  145.     attribute   - the attribute you want to know the value of
  146.  
  147.     RESULT
  148.     Attribute value (depends on object GET method handling)
  149.     or NULL.
  150.  
  151.     EXAMPLE
  152.     printf("Volume is %ld dB\n", mt_Get(obj, MUIA_Slider_Level));
  153.  
  154.     SEE ALSO
  155.  
  156.     BUGS
  157.  
  158. MuiToolkit/mt_ParseHotkey
  159.  
  160.     NAME
  161.     mt_ParseHotkey - parses given string and returns hot key (if any)
  162.  
  163.     SYNOPSIS
  164.     mt_ParseHotkey( string );
  165.                     A0
  166.  
  167.     char mt_ParseHotkey( char *string );
  168.  
  169.     FUNCTION
  170.     However MT powered GUI objects automatically use hotkeys whenever
  171.     available, if it may would be useful (for some purposes) to you to
  172.     find out if in the given string any hotkey is defined, call this
  173.     function. By hotkey, I mean the character (letter, numer etc) that
  174.     should be used e.g. for keyboard object control. Since gadtools
  175.     the standard of defining the hotkey is to prefix the character
  176.     with the underscore ('_'). 
  177.  
  178.     INPUTS
  179.     string      - the string to parse
  180.  
  181.     RESULT
  182.     The first found hotkey character or NULL if there's no such present.
  183.  
  184.     EXAMPLE
  185.     mt_ParseHotkey("What's _the hotkey?");
  186.  
  187.     would return 't' char
  188.     
  189.     SEE ALSO
  190.  
  191.     BUGS
  192.  
  193. MuiToolkit/mt_Label
  194.  
  195.     NAME
  196.     mt_Label - creates label object
  197.  
  198.     SYNOPSIS
  199.     mt_Label( string );
  200.               A0
  201.  
  202.     Object * mt_Label( char *string );
  203.  
  204.     FUNCTION
  205.     Creates so called label. You usually use labels to describe the
  206.     meaning of the gadget (e.g. "Your name" before string gadget is
  207.     the good label example). This function creates such object for
  208.     you, taking care of the proper hotkey handling (if label uses
  209.     such) etc.
  210.  
  211.     INPUTS
  212.     string      - the label text itself
  213.  
  214.     RESULT
  215.     Pointer to created object, or NULL if failed
  216.  
  217.     EXAMPLE
  218.     mt_Label("_Server name:");
  219.  
  220.     SEE ALSO
  221.  
  222.     BUGS
  223.  
  224. MuiToolkit/mt_PopButton
  225.  
  226.     NAME
  227.     mt_PopButton - creates image pop button object
  228.  
  229.     SYNOPSIS
  230.     mt_PopButton( imgage, label )
  231.                   D0      A0
  232.  
  233.     Object * mt_PopButton( int image, char *label );
  234.  
  235.     FUNCTION
  236.     The goal of using this call instead of built-in MUI macro is,
  237.     that your popup button will be automatically cyclechained
  238.     (but that obvious for MT ;-) and you can easily hotkey it.
  239.  
  240.     INPUTS
  241.     image       - the image type (see MUII_#? values)
  242.     label       - the label string, MT will try to extract the
  243.                   hotkey from, or NULL if you either don't have
  244.                   any, or don't want the button to be hotkeyed
  245.  
  246.     RESULT
  247.     Pointer to created object, or NULL if failed
  248.  
  249.     EXAMPLE
  250.     mt_PopButton( MUII_PopUp, GetString( MSG_BAUD_LABEL ) );
  251.  
  252.     SEE ALSO
  253.     libraries/mui.h for MUII_#?
  254.  
  255.     BUGS
  256.  
  257. MuiToolkit/mt_Checkmark
  258.  
  259.     NAME
  260.     mt_Checkmark    - creates checkmark object
  261.  
  262.     SYNOPSIS
  263.     mt_Checkmark( label, value, help )
  264.                   A0     D0     A1
  265.  
  266.     Object * mt_Checkmark( char *label, BOOL value, char *help );
  267.  
  268.     FUNCTION
  269.     The simple way of creating nice checkmark object with one call.
  270.  
  271.     INPUTS
  272.     label       - the label string, MT will try to extract the
  273.                   hotkey from, or NULL if you either don't have
  274.                   any, or don't want the object to be hotkeyed
  275.     value       - startup value of the object (TRUE/FALSE)
  276.     help        - optional pointer to the bubble help text,
  277.                   or NULL if you don't have any
  278.  
  279.     RESULT
  280.     Pointer to created object, or NULL if failed
  281.  
  282.     EXAMPLE
  283.     mt_Checkmark( GetString( LABEL ), FALSE, "Select if you\nwant to ;-)");
  284.  
  285.     SEE ALSO
  286.  
  287.     BUGS
  288.  
  289. MuiToolkit/mt_Cycle
  290.  
  291.     NAME
  292.     mt_Cycle    - creates nice cycle object
  293.  
  294.     SYNOPSIS
  295.     mt_Cycle( array, label, value, help )
  296.               A0     A1     d0     A2
  297.  
  298.     Object * mt_Cycle( char *array, char *label, 
  299.                        ULONG value, char *help );
  300.  
  301.     FUNCTION
  302.     The simple way of creating nice cycle object with one call.
  303.  
  304.     INPUTS
  305.     array       -  Here you can define what entries
  306.                    shall be displayed in your cycle gadget.
  307.                    You must supply a pointer to a string array,
  308.                    containing one entry for each item and
  309.                    terminated with a NULL.
  310.  
  311.                    Remember that cycle gadget entries may
  312.                    contain any text formatting code such
  313.                    as bold, italic or underlined characters.
  314.  
  315.                    Cycle gadgets set the preparse string
  316.                    for all entries to "\33c", this means
  317.                    that they will automatically appear
  318.                    centered. Of course you can override this
  319.                    by simply preceding your entries with own
  320.                    formatting code.
  321.     label       - the label string, MT will try to extract the
  322.                   hotkey from, or NULL if you either don't have
  323.                   any, or don't want the object to be hotkeyed
  324.     value       - startup value of the object
  325.     help        - optional pointer to the bubble help text,
  326.                   or NULL if you don't have any
  327.  
  328.     RESULT
  329.     Pointer to created object, or NULL if failed
  330.  
  331.     EXAMPLE
  332.     static const char *CycleArray[] =
  333.     {
  334.        "normal",
  335.        "highlight",
  336.        "3-dimensional",
  337.        NULL
  338.     };
  339.  
  340.     mt_Cycle( CycleArray, "_Preview", 2, NULL);
  341.  
  342.     SEE ALSO
  343.     Cycle object autodocs
  344.  
  345.     BUGS
  346.  
  347. MuiToolkit/mt_CycleWeight
  348.  
  349.     NAME
  350.     mt_Cycle    - creates nice cycle object with given weight
  351.  
  352.     SYNOPSIS
  353.     mt_Cycle( array, label, value, weight, help )
  354.               A0     A1     d0     D1      A2
  355.  
  356.     Object * mt_Cycle( char *array, char *label, ULONG value,
  357.                        long weight, char *help );
  358.  
  359.     FUNCTION
  360.     The same as mt_Cycle, but you can determine the weight of
  361.     the newly created object.
  362.  
  363.     INPUTS
  364.     array       - Cycle entries
  365.     label       - the label string, MT will try to extract the
  366.                   hotkey from, or NULL if you either don't have
  367.                   any, or don't want the object to be hotkeyed
  368.     value       - startup value of the object
  369.     weight      - weight of the object
  370.     help        - optional pointer to the bubble help text,
  371.                   or NULL if you don't have any
  372.  
  373.     RESULT
  374.     Pointer to created object, or NULL if failed
  375.  
  376.     EXAMPLE
  377.     static const char *CycleArray[] =
  378.     {
  379.        "normal",
  380.        "highlight",
  381.        "3-dimensional",
  382.        NULL
  383.     };
  384.  
  385.     mt_CycleWeight( CycleArray, "_Preview", 2, 50, NULL);
  386.  
  387.     SEE ALSO
  388.     mt_Cycle, Cycle object autodocs, Area/MUIA_Weight
  389.  
  390.     BUGS
  391.  
  392. MuiToolkit/mt_Slider
  393.  
  394.     NAME
  395.     mt_Slider   - creates slider object with one call
  396.  
  397.     SYNOPSIS
  398.     mt_Slider( min, max, level, label, help )
  399.                D0   D1   D2     A0     A1
  400.  
  401.     Object * mt_Slider( int min, int max, int level,
  402.                            char *str, char *help );
  403.  
  404.     FUNCTION
  405.     Creates slider object
  406.  
  407.     INPUTS
  408.     min         - the minimal value
  409.     max         - the maxum
  410.     level       - default level of the knob
  411.     label       - the label string, MT will try to extract the
  412.                   hotkey from, or NULL if you either don't have
  413.                   any, or don't want the object to be hotkeyed
  414.     help        - optional pointer to the bubble help text,
  415.                   or NULL if you don't have any
  416.  
  417.     RESULT
  418.     Pointer to created object, or NULL if failed
  419.  
  420.     EXAMPLE
  421.  
  422.     SEE ALSO
  423.     mt_Slider
  424.  
  425.     BUGS
  426.  
  427. MuiToolkit/mt_SliderFmt
  428.  
  429.     NAME
  430.     mt_SliderFmt   - creates slider object with custom
  431.                      format text
  432.  
  433.     SYNOPSIS
  434.     mt_SliderFmt( min, max, level, label, fmt, help )
  435.                   D0   D1   D2     A0     A1   A2
  436.  
  437.     Object * mt_SliderFmt( int min, int max, int level,
  438.                 char *label, char *fmt, char *help )
  439.  
  440.  
  441.     FUNCTION
  442.     Creates slider object with defined format text
  443.  
  444.     INPUTS
  445.     min         - the minimal value
  446.     max         - the maxum
  447.     level       - default level of the knob
  448.     label       - the label string, MT will try to extract the
  449.                   hotkey from, or NULL if you either don't have
  450.                   any, or don't want the object to be hotkeyed
  451.     fmt         - the format string, where "%ld" instance will
  452.                   be replaced by the current knob value
  453.     help        - optional pointer to the bubble help text,
  454.                   or NULL if you don't have any
  455.  
  456.     RESULT
  457.     Pointer to created object, or NULL if failed
  458.  
  459.     EXAMPLE
  460.     mt_SliderFmt( 10,30,20, "_Delay", "%ld sec.", "Delay in seconds");
  461.  
  462.     SEE ALSO
  463.     mt_Slider, MUIA_Slider_Format
  464.  
  465.     BUGS
  466.  
  467. MuiToolkit/mt_String
  468.  
  469.     NAME
  470.     mt_String       - creates string object
  471.  
  472.     SYNOPSIS
  473.     mt_String( string, maxlen, label, help )
  474.                A0      D0      A1     A2
  475.  
  476.  
  477.     Object * mt_String( char *string, int maxlen,
  478.                           char *label, char *help );
  479.  
  480.     FUNCTION
  481.     Creates string object. Recently MT uses built-in string
  482.     object class to construct the gadget, but future versions may
  483.     automatically (and transparently to your application) benefit
  484.     from all these string gadget replacements like Textinput or
  485.     Betterstring classes
  486.  
  487.     INPUTS
  488.     string      - default string contents (or NULL or "" if none)
  489.     maxlen      - the max len of the string allowed to be entered
  490.                   (including terminating NULL byte)
  491.     label       - the label string, MT will try to extract the
  492.                   hotkey from, or NULL if you either don't have
  493.                   any, or don't want the object to be hotkeyed
  494.     help        - optional pointer to the bubble help text,
  495.                   or NULL if you don't have any
  496.  
  497.     RESULT
  498.     Pointer to created object, or NULL if failed
  499.  
  500.     EXAMPLE
  501.     mt_String( "NoName", 30, "_Project", NULL);
  502.  
  503.     SEE ALSO
  504.     String class autodocs
  505.  
  506.     BUGS
  507.  
  508. MuiToolkit/mt_StringSecret
  509.  
  510.     NAME
  511.     mt_StringSecret     - creates secret string object
  512.  
  513.     SYNOPSIS
  514.     mt_StringSecret( string, maxlen, label, help )
  515.                      A0      D0      A1     A2
  516.  
  517.  
  518.     Object * mt_StringSecret( char *string, int maxlen,
  519.                               char *label, char *help );
  520.  
  521.  
  522.     FUNCTION
  523.     Same as mt_String, but the object will be echoing "*" instead
  524.     of entered characters (good for passwords etc).
  525.  
  526.     INPUTS
  527.     string      - default string contents (or NULL or "" if none)
  528.     maxlen      - the max len of the string allowed to be entered
  529.                   (including terminating NULL byte)
  530.     label       - the label string, MT will try to extract the
  531.                   hotkey from, or NULL if you either don't have
  532.                   any, or don't want the object to be hotkeyed
  533.     help        - optional pointer to the bubble help text,
  534.                   or NULL if you don't have any
  535.  
  536.     RESULT
  537.     Pointer to created object, or NULL if failed
  538.  
  539.     EXAMPLE
  540.     mt_StringSecret( NULL, 30, "_Passwd", NULL);
  541.  
  542.     SEE ALSO
  543.     String class autodocs, MUIA_String_Secret
  544.  
  545.     BUGS
  546.  
  547. MuiToolkit/mt_StringAccept
  548.  
  549.     NAME
  550.     mt_StringAccept     - creates string object with given
  551.                           pool of character pool object accepts
  552.                           for input
  553.  
  554.     SYNOPSIS
  555.     mt_StringAccept( string, maxlen, label, accept, help )
  556.                      A0      D0      A1     A2      A3
  557.  
  558.  
  559.     Object * mt_StringAccept( char *string, int maxlen,
  560.                               char *label, char *accept,
  561.                               char *help );
  562.  
  563.  
  564.     FUNCTION
  565.     Same as mt_String, but you can specify what characters user
  566.     may enter. Useful for e.g. IRC nick etc.
  567.  
  568.     INPUTS
  569.     string      - default string contents (or NULL or "" if none)
  570.     maxlen      - the max len of the string allowed to be entered
  571.                   (including terminating NULL byte)
  572.     accept      - the string with the allowed charasters
  573.     label       - the label string, MT will try to extract the
  574.                   hotkey from, or NULL if you either don't have
  575.                   any, or don't want the object to be hotkeyed
  576.     help        - optional pointer to the bubble help text,
  577.                   or NULL if you don't have any
  578.  
  579.     RESULT
  580.     Pointer to created object, or NULL if failed
  581.  
  582.     EXAMPLE
  583.     mt_StringAccept( NULL, 30, "abcdef", "_Passwd", "Try any digit");
  584.  
  585.     SEE ALSO
  586.     String class autodocs, MUIA_String_Accept
  587.  
  588.     BUGS
  589.  
  590. MuiToolkit/mt_StringReject
  591.  
  592.     NAME
  593.     mt_StringReject     - creates string object with given
  594.                           pool of not allowed characters
  595.  
  596.     SYNOPSIS
  597.     mt_StringReject( string, maxlen, label, reject, help )
  598.                      A0      D0      A1     A2      A3
  599.  
  600.  
  601.     Object * mt_StringReject( char *string, int maxlen,
  602.                               char *label, char *reject,
  603.                               char *help );
  604.  
  605.  
  606.     FUNCTION
  607.     Same as mt_String, but you can specify what characters user
  608.     may enter. Useful for e.g. IRC nick etc.
  609.  
  610.     INPUTS
  611.     string      - default string contents (or NULL or "" if none)
  612.     maxlen      - the max len of the string allowed to be entered
  613.                   (including terminating NULL byte)
  614.     reject      - the string with charasters to reject on input
  615.     label       - the label string, MT will try to extract the
  616.                   hotkey from, or NULL if you either don't have
  617.                   any, or don't want the object to be hotkeyed
  618.     help        - optional pointer to the bubble help text,
  619.                   or NULL if you don't have any
  620.  
  621.     RESULT
  622.     Pointer to created object, or NULL if failed
  623.  
  624.     EXAMPLE
  625.     mt_StringReject( NULL, 30, "0123456789", "_Passwd", "Try any digit");
  626.  
  627.     SEE ALSO
  628.     String class autodocs, MUIA_String_Reject
  629.  
  630.     BUGS
  631.  
  632. MuiToolkit/mt_Button
  633.  
  634.     NAME
  635.     mt_Button            - creates simple button object
  636.  
  637.     SYNOPSIS
  638.     mt_Button( label, help )
  639.                A0     A1
  640.  
  641.  
  642.  
  643.     Object * mt_Button( char *label, char *help );
  644.  
  645.  
  646.     FUNCTION
  647.     Creates ordinary text button object.
  648.  
  649.  
  650.     INPUTS
  651.     label       - the button text. MT will try to extract the
  652.                   hotkey from this string and use it if present
  653.     help        - optional pointer to the bubble help text,
  654.                   or NULL if you don't have any
  655.  
  656.     RESULT
  657.     Pointer to created object, or NULL if failed
  658.  
  659.     EXAMPLE
  660.     mt_Button( "_Save", "Saves the Queen" );
  661.  
  662.     SEE ALSO
  663.  
  664.     BUGS
  665.  
  666. MuiToolkit/mt_ButtonWeight
  667.  
  668.     NAME
  669.     mt_ButtonWeight     - creates simple button object with given
  670.                           object weight
  671.  
  672.     SYNOPSIS
  673.     mt_ButtonWeight( label, weight, help )
  674.                      A0     D0      A1
  675.  
  676.  
  677.  
  678.     Object * mt_ButtonWeight( char *label, int weight, char *help );
  679.  
  680.  
  681.     FUNCTION
  682.     Creates ordinary text button object (same as mt_Button), but
  683.     sets object weight to the given value
  684.  
  685.  
  686.     INPUTS
  687.     label       - the button text. MT will try to extract the
  688.                   hotkey from this string and use it if present
  689.     weight      - object weight
  690.     help        - optional pointer to the bubble help text,
  691.                   or NULL if you don't have any
  692.  
  693.     RESULT
  694.     Pointer to created object, or NULL if failed
  695.  
  696.     EXAMPLE
  697.     mt_ButtonWeight( "_Save", 10, "Saves the Queen" );
  698.  
  699.     SEE ALSO
  700.     MUIA_Weight
  701.  
  702.     BUGS
  703.  
  704. MuiToolkit/mt_ButtonToggle
  705.  
  706.     NAME
  707.     mt_ButtonToggle   - creates simple toggle button object
  708.  
  709.     SYNOPSIS
  710.     mt_ButtonToggle( label, help )
  711.                A0     A1
  712.  
  713.  
  714.  
  715.     Object * mt_ButtonToggle( char *label, char *help );
  716.  
  717.  
  718.     FUNCTION
  719.     Creates ordinary text button object with toggle input mode.
  720.     Useful for button based checkmark alikes.
  721.  
  722.  
  723.     INPUTS
  724.     label       - the button text. MT will try to extract the
  725.                   hotkey from this string and use it if present
  726.     help        - optional pointer to the bubble help text,
  727.                   or NULL if you don't have any
  728.  
  729.     RESULT
  730.     Pointer to created object, or NULL if failed
  731.  
  732.     EXAMPLE
  733.     mt_ButtonToggle( "AutoSave", "If active, would save the Queen every 10 minutes" );
  734.  
  735.     SEE ALSO
  736.     MUIA_InputMode
  737.  
  738.     BUGS
  739.  
  740. MuiToolkit/mt_WinOpen
  741.  
  742.     NAME
  743.     mt_WinOpen   - opens the given window object with the check
  744.  
  745.     SYNOPSIS
  746.     mt_WinOpen( window )
  747.                 A0
  748.  
  749.  
  750.     ULONG mt_WinOpen( Object *window );
  751.  
  752.  
  753.     FUNCTION
  754.     Opens given window object, and checks if window was succesfuly opened.
  755.     The one of major bugs in (even serious MUI apps) is the assumption that
  756.     everything will work fine. So programmers sets the MUIA_Window_Open
  757.     to TRUE and don't bother checking if the window is opened! And there're
  758.     many many situations that may cause the open window to fail. And then
  759.     user is stucked, because e.g. to continue, s/he needs to press "Proceed"
  760.     in unopened window.
  761.  
  762.     INPUTS
  763.     window      - the window object to open
  764.  
  765.     RESULT
  766.     FALSE if window open failed, otherwise TRUE
  767.  
  768.     EXAMPLE
  769.     if( mt_WinOpen( MyWindow ) )
  770.         {
  771.         //... ok, it worked ;-)
  772.         }
  773.     else
  774.         {
  775.         printf( "Can't open window!\n" );
  776.         }
  777.  
  778.     SEE ALSO
  779.     mt_WinClose, MUIA_Window_Open
  780.  
  781.     BUGS
  782.  
  783. MuiToolkit/mt_WinClose                                 * THIS IS A MACRO *
  784.  
  785.     NAME
  786.     mt_WinClose   - closes the given window object
  787.  
  788.     SYNOPSIS
  789.  
  790.     void mt_WinOpen( Object *window );
  791.  
  792.  
  793.     FUNCTION
  794.     Closes given window object.  This is a *MACRO* (see includes), not a
  795.     real library function. It was defined just to pair mt_WinOpen.
  796.  
  797.     INPUTS
  798.     window      - the window object to close
  799.  
  800.     RESULT
  801.  
  802.  
  803.     EXAMPLE
  804.     mt_WinClose( MyWindow );
  805.  
  806.  
  807.     SEE ALSO
  808.     mt_WinOpen, libraries/muitoolkit.h
  809.  
  810.  
  811.     BUGS
  812.  
  813. MuiToolkit/mt_WinAttach
  814.  
  815.     NAME
  816.     mt_WinAttach      - attach the given window object to the application
  817.  
  818.     SYNOPSIS
  819.     mt_WinAttach( app, window )
  820.                   A0   A1
  821.  
  822.  
  823.     ULONG mt_WinAttach( Object *app, Object *window );
  824.  
  825.  
  826.     FUNCTION
  827.     This is a support call for the programmers writting their applications
  828.     in the Right Way{tm}, with the dynamically created objects. Imagine
  829.     your program offers 20 various windows for various purposes. Creating
  830.     all of them at the program start is just a waste of time and resources.
  831.     The Right Way{tm} is to create them only when necessary (e.g. user is
  832.     going to use it), attach the created window object to application,
  833.     and then destroy when user finished (note: sometimes may be better to
  834.     keep created windows. That prevents the gadgets contents from being lost
  835.     which in result would force the user to select/type/pick the values
  836.     again, which may be unwanted feature for some kind of applications).
  837.  
  838.     It's safe to pass NULL as any of the argument.
  839.  
  840.  
  841.     INPUTS
  842.     app         - the application object the window should be added to
  843.     window      - the window object to add
  844.  
  845.     RESULT
  846.     FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
  847.  
  848.     EXAMPLE
  849.  
  850.     Object *win = WindowObject,
  851.                     // our dynamically created window...,
  852.                     End;
  853.  
  854.  
  855.     if( mt_WinAttach( app, win ) )
  856.         {
  857.         if( mt_WinOpen( MyWindow ) )
  858.             {
  859.             //... ok, it worked ;-)
  860.             }
  861.         else
  862.             {
  863.             printf( "Can't open window!\n" );
  864.             }
  865.         }
  866.  
  867.     SEE ALSO
  868.     mt_WinDetach
  869.  
  870.     BUGS
  871.     Recently, return value indicates that the function arguments were
  872.     correct (both are not NULL), and NOT that the window is succesfuly
  873.     attached. Further versions will do that check anyway.
  874.  
  875. MuiToolkit/mt_WinDetach
  876.  
  877.     NAME
  878.     mt_WinDetach   - detach the given window object from the application
  879.  
  880.     SYNOPSIS
  881.     mt_WinDetach( app, window )
  882.                   A0   A1
  883.  
  884.  
  885.     void mt_WinDetach( Object *app, Object *window );
  886.  
  887.  
  888.     FUNCTION
  889.     This function removes the given window from the applicatin. It,
  890.     at least recently, does nothing else that OM_REMMEMBER, however
  891.     further releases will offer more features here. If you added
  892.     windows with mt_WinAttach, you should remove them with thah call
  893.  
  894.     It's safe to pass NULL as any of the argument.
  895.     
  896.  
  897.     INPUTS
  898.     app         - the application the window should be removed from
  899.     window      - the window object to remove
  900.  
  901.     RESULT
  902.     FALSE if window couldn't be added, otherwise TRUE. See the BUGS!
  903.  
  904.     EXAMPLE
  905.     mt_WinDetach( app, win ) );
  906.  
  907.     SEE ALSO
  908.  
  909.     BUGS
  910.  
  911. MuiToolkit/mt_Text
  912.  
  913.     NAME
  914.     mt_Text       - creates text object
  915.  
  916.     SYNOPSIS
  917.     mt_Text( text, preparse)
  918.              A0    A1
  919.  
  920.  
  921.     Object * mt_Text( char *text, char *preparse );
  922.  
  923.  
  924.     FUNCTION
  925.     Creates ordinary text object with
  926.  
  927.  
  928.     INPUTS
  929.     text      - contents of the text obejct
  930.     preparse  - MUI preparse formatter (e.g. "\033c" for centering)
  931.  
  932.     RESULT
  933.     Pointer to created object, or NULL if failed
  934.  
  935.  
  936.     EXAMPLE
  937.     mt_WinDetach( app, win ) );
  938.  
  939.     SEE ALSO
  940.  
  941.     BUGS
  942.  
  943. MuiToolkit/mt_GetString
  944.  
  945.     NAME
  946.     mt_GetString    - Full featured string requester
  947.  
  948.  
  949.     mt_GetStringA(app, buffer, buf_len, tags)
  950.                   A0   A1      D0       A2
  951.  
  952.     LONG mt_GetStringA ( Object *app, char *buffer, ULONG buf_len,
  953.                          struct TagItem *tags );
  954.  
  955.     LONG mt_GetString ( Object *app, char *buffer, ULONG buf_len, ... );
  956.  
  957.  
  958.     FUNCTION
  959.     Pops up a string requester. 
  960.  
  961.  
  962.  
  963.     INPUTS
  964.     app       - application object
  965.  
  966.     buffer    - pointer to the memory area (array etc), where the user
  967.                 entered string will be placed
  968.  
  969.     buf_len   - max lenght of the buffer
  970.  
  971.     tags      - optional tags. If you don't want to use any, put TAG_DONE
  972.                 See TAGS below
  973.  
  974.  
  975.     TAGS
  976.     mt_StrReq_WinTitle    - (STRPTR) custom requester window title
  977.  
  978.     mt_StrReq_Contents    - (STRPTR) default string gadget contents
  979.     
  980.     mt_StrReq_Ok          - (STRPTR) text you want to have as OK button
  981.  
  982.     mt_StrReq_Cancel      - (STRPTR) text you want to have as the CANCEL
  983.                             button
  984.  
  985.     mt_StrReq_Secret      - (BOOL) if TRUE, turns the requester into Secret
  986.                             mode. In that mode, only "*" are echoed instead
  987.                             of entered characters (good for passwords etc).
  988.                             Default: FALSE
  989.  
  990.     mt_StrReq_NoEmpty     - (BOOL) if TRUE, requester won't accept the empty
  991.                             string as the positive answers. User will have
  992.                             to click CANCEL to dismiss the requester, or
  993.                             type something. Good to force users to give e.g.
  994.                             new account name etc.
  995.  
  996.     mt_StrReq_GroupTitle  - (STRPTR) the replacement string for "Enter string"
  997.                             string gadget header
  998.  
  999.     mt_StrReq_Info        - (STRPTR) by using this tag, you can add extra info
  1000.                             text panel above the string gadget, with detailed
  1001.                             description or whatever you want. See the demo
  1002.                             
  1003.     mt_StrReq_StringHelp  - (STRPTR) optional bubble help text
  1004.  
  1005.  
  1006.     RESULT
  1007.     TRUE if user gave valid positive answer, otherwise FALSE
  1008.  
  1009.  
  1010.     EXAMPLE
  1011.     char buf[40];
  1012.     mt_GetString( app, buf, sizeof(buf),
  1013.                     mt_StrReq_Contents, "Hello",
  1014.                     TAG_DONE );
  1015.  
  1016.  
  1017.     SEE ALSO
  1018.     mt_demo.c
  1019.  
  1020.     BUGS
  1021.  
  1022. MuiToolkit/mt_GetInteger
  1023.  
  1024.     NAME
  1025.     mt_GetInteger    - Full featured integer requester
  1026.  
  1027.  
  1028.     mt_GetIntegerA(app, value, tags)
  1029.                    A0   A1     A2
  1030.  
  1031.     LONG mt_GetIntegerA ( Object *app, LONG *value, struct TagItem *tags );
  1032.  
  1033.     LONG mt_GetInteger ( Object *app, LONG *value, ... );
  1034.  
  1035.  
  1036.     FUNCTION
  1037.     Pop up a numeric requester. Recently it supports integers only, but
  1038.     both positive and negative values are properly handled.
  1039.  
  1040.  
  1041.     INPUTS
  1042.     app       - application object
  1043.     value     - pointer to the longword (32 bit) where the, where the user
  1044.                 entered value will be returned
  1045.     tags      - optional tags. If you don't want to use any, put TAG_DONE
  1046.                 See TAGS below
  1047.  
  1048.  
  1049.     TAGS
  1050.     mt_IntReq_WinTitle    - (STRPTR) custom requester window title
  1051.  
  1052.     mt_IntReq_Value       - (LONG) default string gadget contents
  1053.     
  1054.     mt_IntReq_Ok          - (STRPTR) text you want to have as OK button
  1055.  
  1056.     mt_IntReq_Cancel      - (STRPTR) text you want to have as the CANCEL
  1057.                             button
  1058.  
  1059.     mt_IntReq_Min         - (LONG) Optional, min value requester can accept
  1060.                             as correct answer
  1061.  
  1062.     mt_IntReq_Max         - (LONG) Optional, max value requester can accept
  1063.                             as correct answer
  1064.  
  1065.     mt_IntReq_GroupTitle  - (STRPTR) the replacement string for "Enter string"
  1066.                             string gadget header
  1067.  
  1068.     mt_IntReq_Info        - (STRPTR) by using this tag, you can add extra info
  1069.                             text panel above the string gadget, with detailed
  1070.                             description or whatever you want. See the demo
  1071.                             
  1072.     mt_IntReq_StringHelp  - (STRPTR) optional bubble help text
  1073.  
  1074.  
  1075.     RESULT
  1076.     TRUE if user gave valid positive answer, otherwise FALSE
  1077.  
  1078.  
  1079.     EXAMPLE
  1080.  
  1081.     LONG val;
  1082.     mt_GetInteger( app, &val,
  1083.                            mt_IntReq_Min, 30,
  1084.                            mt_IntReq_Max, 50,
  1085.                            TAG_DONE );
  1086.  
  1087.     SEE ALSO
  1088.     mt_demo.c
  1089.  
  1090.     BUGS
  1091.  
  1092. MuiToolkit/mt_Radio
  1093.  
  1094.     NAME
  1095.     mt_Radio          - creates radio button
  1096.  
  1097.     SYNOPSIS
  1098.     mt_Radio( array, label, help )
  1099.                A0    A1     A2
  1100.  
  1101.  
  1102.     Object * mt_Radio( char *array, char *label, char *help );
  1103.  
  1104.  
  1105.     FUNCTION
  1106.     Creates radio buttons.
  1107.  
  1108.  
  1109.     INPUTS
  1110.     array      - Here you can define what entries shall be
  1111.                  displayed in your radio gadget. You must
  1112.                  supply a pointer to a string array, containing
  1113.                  one entry for each item and terminated with a NULL.
  1114.  
  1115.                  Remember that radio gadget entries may contain any
  1116.                  text formatting code such as bold, italic or
  1117.                  underlined characters.
  1118.  
  1119.     label       - the label string, MT will try to extract the
  1120.                   hotkey from, or NULL if you either don't have
  1121.                   any, or don't want the button to be hotkeyed
  1122.  
  1123.     help        - optional pointer to the bubble help text,
  1124.                   or NULL if you don't have any
  1125.  
  1126.     RESULT
  1127.     Pointer to created object, or NULL if failed
  1128.  
  1129.     EXAMPLE
  1130.     char *radio[] = { "Apples",
  1131.                       "Bananas",
  1132.                       "Plums",
  1133.                       NULL };
  1134.     mt_Radio( radio, GetString( Label ), "ShortHelp" );
  1135.  
  1136.     SEE ALSO
  1137.     mt_demo.c
  1138.  
  1139.     BUGS
  1140.  
  1141. MuiToolkit/mt_Check
  1142.  
  1143.     NAME
  1144.     mt_Check          - expanded checkmark object
  1145.  
  1146.     SYNOPSIS
  1147.     mt_Check( label, alignment, state, help )
  1148.                A0    D0         D1     A1
  1149.  
  1150.  
  1151.     Object * mt_Check( char *label, ULONG alignment,
  1152.                         ULONG state, char *help);
  1153.  
  1154.  
  1155.     FUNCTION
  1156.     Creates expanded checkmark object. This function can can
  1157.     create ordinary checkmark, as well as complex one, with
  1158.     its label.
  1159.  
  1160.  
  1161.     INPUTS
  1162.     label      - the checkmark label string. If not NULL and
  1163.                  alignmet is not mt_Check_NoLabel, MT will
  1164.                  create a label, next to the checkmark object.
  1165.                  MT will as usual try to extract the hotkey from
  1166.                  this string as well
  1167.  
  1168.     alignment  - if label is not NULL, you can specify the way
  1169.                   MT should handle it. Available options are:
  1170.  
  1171.                   mt_Check_NoLabel    - don't create the label,
  1172.                                         just use the string as
  1173.                                         hotkey source
  1174.                   mt_Check_AlignRight - create label on the right
  1175.                                         side of the checkmark
  1176.                   mt_Check_AlignLeft  - create label on the left
  1177.                                         side of the checkmark
  1178.  
  1179.     state      - (BOOL) state of the checkmark
  1180.  
  1181.     help       - optional pointer to the bubble help text,
  1182.                  or NULL if you don't have any
  1183.  
  1184.     RESULT
  1185.     Pointer to created object, or NULL if failed
  1186.  
  1187.     EXAMPLE
  1188.     mt_Check( "_Check 1", mt_Check_AlignRight, FALSE, "ShortHelp" ),
  1189.  
  1190.     SEE ALSO
  1191.     mt_demo.c
  1192.  
  1193.     BUGS
  1194.  
  1195.